Repository navigation
Conversation
APNG: decoding (broken animations fall back to the default image, like browsers do) and encoding with full alpha; the frame compositing follows the APNG spec's integer "over" operation. Matches Pillow on its APNG test files, except where Pillow blends semi-transparent pixels differently from the spec. Animation is the new base class of GIF: Animation.decode() reads GIF and APNG (still images become one frame), encodeGIF() and encodeAPNG() write them. GIF keeps its API, Image.decode() still returns an APNG's default image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
GIF only adds encode() (encodeGIF), a decode() that accepts nothing but GIFs (Animation.decode) and its toString. It stays fully working in 3.x, editors show it as deprecated with the replacement; removal is planned for 4.0. Frame's documentation now talks about animations instead of GIFs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Animation, a format-independent base class for animated images, and APNG decoding/encoding.GIFbecomes a subclass ofAnimationand is deprecated in its favor.New
Animation: an array ofFrames withloopCount,width/height/duration,resize()andslice(). This is the same APIGIFhad, but not tied to one format.Animation.decode(data)decodes GIFs and APNGs into fully composited frames. Still images become a single frame.encodeGIF(quality)andencodeAPNG(compression)encode it.Image.decode()keeps returning an APNG's default image.Deprecated
GIF: useAnimationinstead.new GIF(frames).encode()becomesnew Animation(frames).encodeGIF(), andGIF.decode()becomesAnimation.decode().GIFkeeps working unchanged in 3.x, anddecode()still returnsGIFinstances for GIF files.Testing
tests/animation.js.Closes #6